package com.fileupload.exception;

/**
 * 文件上传异常类
 */
public class FileUploadException extends RuntimeException {
    
    private String errorCode;
    private String errorMessage;
    private Throwable cause;
    
    public FileUploadException(String message) {
        super(message);
        this.errorMessage = message;
    }
    
    public FileUploadException(String message, Throwable cause) {
        super(message, cause);
        this.errorMessage = message;
        this.cause = cause;
    }
    
    public FileUploadException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.errorMessage = message;
    }
    
    public FileUploadException(String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.errorMessage = message;
        this.cause = cause;
    }
    
    public String getErrorCode() {
        return errorCode;
    }
    
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
    
    @Override
    public String getMessage() {
        return errorMessage;
    }
    
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
    
    @Override
    public Throwable getCause() {
        return cause;
    }
    
    public void setCause(Throwable cause) {
        this.cause = cause;
    }
}